<div class=" ui-portlet" id="wechat-msg-mine-list">
	<div>
		当前公众号：{{$current_wxinfo['Wx']['name']}}
	</div>
       	<div style="text-align:center;margin:10px auto;">{{$page_navi}}</div>
	       <div class="row">
	       {{loop $medialist $mk $item}}
	       	<?php //选择时，图片的url可以直接设置到字段中 ?>
	       	<div class="col-md-4" data-mid="{{$item['media_id']}}" {{if $item['url']}} data-url="{{$item['url']}}"{{/if}}>
	       		<div style="padding:5px;margin-bottom:5px;border:1px solid #DDD;">
	       		<p>{{date('Y-m-d H:i',$item['update_time'])}}</p>
	       		
	       		{{if $type=='news' || $type=='link'}}
					<?php $count = count($item['content']['news_item']); ?>
					{{loop $item['content']['news_item'] $ak $article}}
								{{if $ak==0}}
						       		<div class="appmsg article-msg clearfix" id="article-msg-{{$ak}}"  data-id="{{$ak}}">
							       		<div class="appmsg_content  clearfix">
							       		<p class="title">
							       			<a class="wechat-edit hidden" data-mid="{{$item['media_id']}}" title="编辑" data-idx="{{$ak}}"><i class="fa fa-edit"></i></a><a href="{{$article['url']}}" target="_blank">{{$article['title']}}</a>
							       		</p>
							       		{{$this->Html->image('/wx_msgs/wechat_thumb?mid='.$article['thumb_media_id'],array('class'=>'cover'))}}
									{{if $count==1}}		       		
									<p class="appmsg_desc summary">{{usubstr($article['digest'],0,32)}}</p>
									{{/if}}
							       		</div>
								{{else}}
									<div class="submsg-title clearfix">
									{{$this->Html->image('/wx_msgs/wechat_thumb?mid='.$article['thumb_media_id'],array('class'=>'cover pull-right'))}}
										<p class="title">
					                         <a class="wechat-edit hidden" data-mid="{{$item['media_id']}}" title="编辑" data-idx="{{$ak}}"><i class="fa fa-edit"></i></a><a href="{{$article['url']}}" target="_blank">{{$article['title']}}</a>
					                    </p>
									</div>
								{{/if}}
								{{if $ak == $count-1}}
										{{if $_REQUEST['type'] == 'select'}}
										<div class="appmsg_opr clearfix">
											<a href="javascript:void(0)" class="col-xs-12 choose-media" data-mid="{{$item['media_id']}}" ><i  class="glyphicon glyphicon-check"></i>选择</a>
										</div>
										{{else}}
							       		<div class="appmsg_opr clearfix">
							       			<!-- {{$this->Html->link('<i data-toggle="tooltip" target="_blank"  data-placement="top" title="'.__('Edit').'" class="fa fa-edit"></i>', array('controller'=>'wx_msgs','action' => 'weMsgEdit',$item['media_id'],$ak),array('class'=>'col-xs-6 opr-edit','data-id'=>$item['media_id'],'escape'=>false))}} -->
							       			<a href="javascript:void(0)" data-url="{{$this->Html->url('/wx_msgs/wechatDelete/'.$item['media_id'])}}" class="col-xs-12 delete-pop" data-content="确定删除此素材？"><i title="{{__('Delete')}}" class="fa fa-trash"></i></a>
							       			
							       		</div>
							       		{{/if}}
						       		</div>
								{{/if}}
					  {{/loop}}
				{{elseif $type == 'image'}}
						<p title="{{$item['name']}}">{{usubstr($item['name'],0,10)}}</p>
						<!-- <img src="{{$item['url']}}" style="width:200px;height:200px">  -->
						<p style="text-align:center;">
						<iframe width="200px" height="200px" frameborder="0" src="javascript:void(function(){document.open();document.write(&quot;<!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml' class='view' ><head><style>*{margin:0;padding:0}</style></head><body style='margin:0;padding:0;'><p style='text-align:center;'><img style='max-width:195px;max-height:195px;background: #eee;' src='{{$item['url']}}'></p></body></html>&quot;);document.close();}())"></iframe>
						</p>
						{{if $_REQUEST['type'] == 'select'}}
							<div class="appmsg_opr clearfix">
								<a href="javascript:void(0)" class="col-xs-12 choose-media" data-mid="{{$item['media_id']}}"   {{if $item['url']}} data-url="{{$item['url']}}"{{/if}} ><i  class="glyphicon glyphicon-check"></i>选择</a>
							</div>
						{{/if}}
				{{elseif $type == 'video'}}
						<p title="{{$item['name']}}" data-toggle="tooltip" data-container="body">{{substr($item['name'],0,10)}}</p>
						{{if $_REQUEST['type'] == 'select'}}
							<div class="appmsg_opr clearfix">
								<a href="javascript:void(0)" class="col-xs-12 choose-media" data-mid="{{$item['media_id']}}" ><i  class="glyphicon glyphicon-check"></i>选择</a>
							</div>
						{{/if}}
				{{elseif $type == 'voice'}}
						<p title="{{$item['name']}}" data-toggle="tooltip" data-container="body">{{substr($item['name'],0,10)}}</p>
						{{if $_REQUEST['type'] == 'select'}}
							<div class="appmsg_opr clearfix">
								<a href="javascript:void(0)" class="col-xs-12 choose-media" data-mid="{{$item['media_id']}}" ><i  class="glyphicon glyphicon-check"></i>选择</a>
							</div>
						{{/if}}
				{{/if}}
	       		
	       	</div>
	       	</div>
	       		{{if $mk%3 == 2}} <div class="clearfix"></div> {{/if}}
	  		{{/loop}}
	    	</div>
    		<div style="text-align:center;margin:10px auto;">{{$page_navi}}</div>
</div>
